#pragma once

#include <map>
#include <functional>
#include <string_view>

#include "co/http.h"

namespace gd__ {
    struct httpServerConf {
        static std::map<std::string, std::function<void(http::Req const &, http::Res &)>> methods;

        static void httpOnReq(http::Req const &, http::Res &);

        static void onInsertLog(http::Req const &, http::Res &);
        static void onGetLogByName(http::Req const &, http::Res &);
        static void onGetLogBySite(http::Req const &, http::Res &);
        static void onGetLogByTime(http::Req const &, http::Res &);

        static void addSuccessHeader(http::Res &);
        static void addFailedHeader(http::Res &, std::string const &);
    };
}